package com.spareparts.protocol;

import org.json.JSONException;
import org.json.JSONObject;

import com.spareparts.entyties.UserInfo;

import cm.framework.protocol.BaseJSONRsponse;


public class LoginResponse extends BaseJSONRsponse 
{
	public UserInfo mUserInfo = new UserInfo();

	@Override
	protected boolean extractBody(JSONObject arg0)
	{
		try 
		{
			JSONObject dataJsonObject = arg0.getJSONObject("res");
			if ( dataJsonObject != null )
			{
				mUserInfo.userId = dataJsonObject.getString("userid");
				mUserInfo.userName = dataJsonObject.getString("username");
			}
		}
		catch (JSONException e)
		{
			e.printStackTrace();
		}
		return true;
	}

}
